package net.cathackers.devel.scmp.config.impl;

import java.util.Properties;


public class AuthenticatorDBConfig extends XMLDBConfig {
    protected final String PASS_FIELD  = "passwordField";
    protected final String USER_FIELD  = "usernameField";
    protected final String ISBLOCKED_FIELD = "isBlockedFieldName";
    protected final String LASTLOGIN_FIELD  = "lastLoginFieldName";
    
    public AuthenticatorDBConfig() {
        super();
    }
    
    public AuthenticatorDBConfig(Properties backend) {
        super(backend);
    }

    public AuthenticatorDBConfig(String configFile) {
        super(configFile);
    }
    
    public AuthenticatorDBConfig(XMLDBConfig configuration) {
	super();
	super.backend_ = configuration.getBackend();
    }
    
    public String getUsernameFieldName() {
        return backend_.getProperty(USER_FIELD, "username");
    }
    public void setUsernameFieldName(String dbUsernameFieldName) {
        backend_.setProperty(USER_FIELD, dbUsernameFieldName);
    }
    
    public String getPasswordFieldName() {
        return backend_.getProperty(PASS_FIELD, "password");
    }
    public void setPasswordFieldName(String dbPasswordFieldName) {
        backend_.setProperty(PASS_FIELD, dbPasswordFieldName);
    }
    
    public String getIsBlockedFieldName() {
        return backend_.getProperty(ISBLOCKED_FIELD, "isBlocked");
    }
    
    public void setIsBlockedFieldName(String dbIsBlockedFieldName) {
        backend_.setProperty(ISBLOCKED_FIELD, dbIsBlockedFieldName);
    }
    
    public String getLastLoginFieldName() {
        return backend_.getProperty(LASTLOGIN_FIELD, "lastLogin");
    }
    public void setLastLoginFieldName(String dbLastLoginFieldName) {
        backend_.setProperty(LASTLOGIN_FIELD, dbLastLoginFieldName);
    }
}
